/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.Timer;

import negocio.AlreadyExistsException;
import negocio.Asistencia;
import negocio.DataBase;
import negocio.PerfilInscrito;

/**
 *
 * @author Marcelo
 */
public class InscripcionFrm extends javax.swing.JFrame {

    Timer timer = null;
    /**
     * Creates new form InscripcionFrm
     */
    public InscripcionFrm() {
        initComponents();
        
        DataBase.getNewConnection();
        txtCodigoBarras.requestFocus();
        
        lblHora.setText("");
        timer = new Timer(1000, new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                
                Date hora = new Date();
                DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
                
        lblHora.setText(dateFormat.format(hora));
            }
        });
        timer.setInitialDelay(1);
        timer.start();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        txtCodigoBarras = new javax.swing.JTextField();
        cmdIngresar = new javax.swing.JButton();
        jLabel3 = new javax.swing.JLabel();
        cboSesion = new javax.swing.JComboBox();
        cmdConsultar = new javax.swing.JButton();
        jButton1 = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JSeparator();
        chkIngresarPorEnter = new javax.swing.JCheckBox();
        lblHora = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        cboDia = new javax.swing.JComboBox();
        jPanel1 = new javax.swing.JPanel();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel2 = new javax.swing.JPanel();
        txtNombres = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        txtEstado = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        txtHora = new javax.swing.JTextField();
        txtCedula = new javax.swing.JTextField();
        txtCodigoBarrasConsulta = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Control de Asistencia");
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosed(java.awt.event.WindowEvent evt) {
                formWindowClosed(evt);
            }
        });

        txtCodigoBarras.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtCodigoBarrasActionPerformed(evt);
            }
        });
        txtCodigoBarras.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txtCodigoBarrasKeyPressed(evt);
            }
        });

        cmdIngresar.setText("Ingresar");
        cmdIngresar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cmdIngresarActionPerformed(evt);
            }
        });

        jLabel3.setText("Sesión:");

        cboSesion.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        cboSesion.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Entrada en la Mañana", "Regreso de Refrigerio Mañana", "Salida en la Mañana", "Entrada en la Tarde", "Regreso Refrigerio Tarde", "Salida en la Tarde" }));
        cboSesion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cboSesionActionPerformed(evt);
            }
        });

        cmdConsultar.setText("Consultar");
        cmdConsultar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cmdConsultarActionPerformed(evt);
            }
        });

        jButton1.setText("Cerrar");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        chkIngresarPorEnter.setSelected(true);
        chkIngresarPorEnter.setText("Ingresar presionando Enter");
        chkIngresarPorEnter.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                chkIngresarPorEnterActionPerformed(evt);
            }
        });

        lblHora.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        lblHora.setText("hora");

        jLabel1.setText("Código Barras:");

        cboDia.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        cboDia.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Día 1", "Día 2", "Día 3" }));
        cboDia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cboDiaActionPerformed(evt);
            }
        });

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos"));

        txtNombres.setEditable(false);
        txtNombres.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N

        jLabel2.setText("Nombres:");

        txtEstado.setEditable(false);

        jLabel4.setText("Estado:");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2)
                    .addComponent(jLabel4))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtEstado)
                    .addComponent(txtNombres, javax.swing.GroupLayout.DEFAULT_SIZE, 555, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(21, 21, 21)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(txtNombres, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtEstado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel4))
                .addContainerGap(22, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Nombres", jPanel2);

        txtHora.setEditable(false);

        txtCedula.setEditable(false);

        txtCodigoBarrasConsulta.setEditable(false);

        jLabel6.setText("Código Barras:");

        jLabel5.setText("Cédula:");

        jLabel7.setText("Hora:");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel7)
                    .addComponent(jLabel5)
                    .addComponent(jLabel6))
                .addGap(18, 18, 18)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtHora, javax.swing.GroupLayout.DEFAULT_SIZE, 516, Short.MAX_VALUE)
                    .addComponent(txtCedula)
                    .addComponent(txtCodigoBarrasConsulta, javax.swing.GroupLayout.Alignment.TRAILING))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtCodigoBarrasConsulta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtCedula, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(txtHora, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(31, 31, 31))
        );

        jTabbedPane1.addTab("Detalles", jPanel3);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addComponent(jTabbedPane1)
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 9, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(6, 6, 6)
                        .addComponent(lblHora, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jButton1))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel3)
                            .addComponent(jLabel1))
                        .addGap(28, 28, 28)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(txtCodigoBarras)
                            .addComponent(cboSesion, 0, 186, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(cmdIngresar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(cboDia, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(cmdConsultar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(chkIngresarPorEnter)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cboSesion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3)
                    .addComponent(cboDia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtCodigoBarras, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(cmdIngresar)
                        .addComponent(cmdConsultar)
                        .addComponent(chkIngresarPorEnter)
                        .addComponent(jLabel1)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton1)
                    .addComponent(lblHora))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    
    private boolean esSesionCorrecta()
    {
        if ( cboDia.getSelectedIndex() == 0 && cboSesion.getSelectedIndex() < 4 )
        {
            return false;
        }
        return true;
    }
    
    private void vaciarResultados()
    {
        txtNombres.setText("");
        txtEstado.setText("");
        
        txtCedula.setText("");
        txtCodigoBarrasConsulta.setText("");
    }
    
    private void ingresar()    
    {

        vaciarResultados();
        if (!esSesionCorrecta())
        {
            txtEstado.setText("Revise la sesion antes de ingresar");
            txtCodigoBarras.setText("");
            txtCodigoBarras.requestFocus();
            return;
        }
        
        String codigo = txtCodigoBarras.getText().toLowerCase();
        if (codigo.trim().length() == 0)
        {
            txtEstado.setText("Ingrese el código");
            return;
        }
        
        
        PerfilInscrito perfil = PerfilInscrito.encontrarPorCodigo(codigo);
        if (perfil != null)
        {
            //txtNombres.setText( perfil.getApellidos() + " " + perfil.getNombres() );
            mostrarDatosDe(perfil);        
            
            Date hora = new Date();
            
            
            Asistencia asistencia = new Asistencia();
            asistencia.setCodigoinscrito( perfil.getCodigo() );
            asistencia.setHora( hora );
            asistencia.setSesion( obtieneSesion() );                            

            DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            //txtHora.setText( dateFormat.format(hora));
            try {
                Asistencia.agregarNuevo( asistencia );
            
            
                txtEstado.setText("CORRECTO");
                
            } catch (AlreadyExistsException ex) {
                //System.err.println("No se pudo agregar a " + codigo);
                txtEstado.setText("YA INGRESADO ANTERIORMENTE");
                
                Asistencia existente = Asistencia.encontrarPorCodigoSesion(codigo, obtieneSesion());
                
                txtHora.setText( existente.getHora() );
                //Logger.getLogger(InscripcionFrm.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        else
        {
            
            txtEstado.setText("No encontrado");
        }        
        txtCodigoBarras.setText("");
        txtCodigoBarras.requestFocus();        
    }
    
    private void mostrarDatosDe(PerfilInscrito perfil)
    {
        txtNombres.setText( perfil.getApellidos() + " " + perfil.getNombres() );
        txtCedula.setText(perfil.getCedula());
        txtCodigoBarrasConsulta.setText( perfil.getCodigo() );
        
    }
    
    private void cmdIngresarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmdIngresarActionPerformed
        // TODO add your handling code here:
        
        ingresar();


    }//GEN-LAST:event_cmdIngresarActionPerformed

    private int obtieneSesion()
    {
        return cboSesion.getSelectedIndex() + cboSesion.getItemCount()*cboDia.getSelectedIndex();
    }
    
    private void consultar()
    {
        vaciarResultados();
        
        String codigo = txtCodigoBarras.getText().toLowerCase();
        if (codigo.trim().length() == 0)
        {
            txtEstado.setText("Ingrese el código");
            return;
        }
        
        
        PerfilInscrito perfil = PerfilInscrito.encontrarPorCodigo(codigo);
        if (perfil != null)
        {
            mostrarDatosDe(perfil);            
            
            int sesion = obtieneSesion();
            Asistencia asistencia = Asistencia.encontrarPorCodigoSesion( codigo, sesion );
            
            if (asistencia != null)
            {
                txtEstado.setText("YA REGISTRADO");
                //txtHora.setText("");
                txtHora.setText( asistencia.getHora() );
            }
            else
                txtEstado.setText("AUN NO REGISTRADO");
            //txtNombres.setText( perfil.getApellidos() + " " + perfil.getNombres() );
        }
        else
        {
            txtEstado.setText("No encontrado");
        }
        txtCodigoBarras.setText("");
        txtCodigoBarras.requestFocus();
    }
    
    private void cmdConsultarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmdConsultarActionPerformed
        // TODO add your handling code here:
        consultar();
    }//GEN-LAST:event_cmdConsultarActionPerformed

    private void txtCodigoBarrasKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtCodigoBarrasKeyPressed
        // TODO add your handling code here:
        
        if (evt.getKeyChar() == '\n' )
        {
            //System.out.println("Enter");
            
            if (chkIngresarPorEnter.isSelected())
            {
                ingresar();
            }
            else
                consultar();
        }
    }//GEN-LAST:event_txtCodigoBarrasKeyPressed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        this.dispose();
    }//GEN-LAST:event_jButton1ActionPerformed

    private void txtCodigoBarrasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtCodigoBarrasActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtCodigoBarrasActionPerformed

    private void chkIngresarPorEnterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkIngresarPorEnterActionPerformed
        // TODO add your handling code here:
        txtCodigoBarras.requestFocus();
    }//GEN-LAST:event_chkIngresarPorEnterActionPerformed

    private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed
        // TODO add your handling code here:
        if (timer != null)
            timer.stop();
    }//GEN-LAST:event_formWindowClosed

    private void cboSesionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cboSesionActionPerformed
        // TODO add your handling code here:
        txtCodigoBarras.requestFocus();
    }//GEN-LAST:event_cboSesionActionPerformed

    private void cboDiaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cboDiaActionPerformed
        // TODO add your handling code here:
        txtCodigoBarras.requestFocus();
    }//GEN-LAST:event_cboDiaActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(InscripcionFrm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(InscripcionFrm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(InscripcionFrm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(InscripcionFrm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                InscripcionFrm frm = new InscripcionFrm();
                frm.setLocationRelativeTo(null);
                frm.setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JComboBox cboDia;
    private javax.swing.JComboBox cboSesion;
    private javax.swing.JCheckBox chkIngresarPorEnter;
    private javax.swing.JButton cmdConsultar;
    private javax.swing.JButton cmdIngresar;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JLabel lblHora;
    private javax.swing.JTextField txtCedula;
    private javax.swing.JTextField txtCodigoBarras;
    private javax.swing.JTextField txtCodigoBarrasConsulta;
    private javax.swing.JTextField txtEstado;
    private javax.swing.JTextField txtHora;
    private javax.swing.JTextField txtNombres;
    // End of variables declaration//GEN-END:variables
}
